# Contributor: omni <omni+alpine@hack.org>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=rtl_433
pkgver=24.10
pkgrel=0
pkgdesc="Program to decode transmissions on the ISM bands"
url="https://github.com/merbanan/rtl_433"
arch="all"
license="GPL-2.0-or-later"
makedepends="
	cmake
	librtlsdr-dev
	libusb-dev
	openssl-dev>3
	samurai
	"
subpackages="$pkgname-doc $pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/merbanan/rtl_433/archive/refs/tags/$pkgver.tar.gz"

# secfixes:
#   21.12-r3:
#     - CVE-2022-25050
#     - CVE-2022-25051
#     - CVE-2022-27419

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_SYSCONFDIR=/etc
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
b1ced33a568a7b51425268deeb14cf9750f1d4458025fda7c69b557ba8df38350bff562a7d0b69fbea8c00357bd6e6c86e69c2e231d0754d8226a656f4814d02  rtl_433-24.10.tar.gz
"
